package itheima_06;

//try catch
public class ExceptionDemo03 {

    public static void main(String[] args) {
        System.out.println("开始");
        method();
        System.out.println("结束");
    }

    public static void method() {
        try {
            int[] arr = new int[]{1, 2, 3};
            System.out.println(arr[3]);//new ArrayIndexOutOfBoundsException(); 创建了一个对象
        } catch (ArrayIndexOutOfBoundsException e) {
            e.printStackTrace();
        }
    }
}
